<?php
/*
 * Created on 07.12.2008
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
include_once 'JF_IView.php';
include_once 'JF_Layout.php';
include_once 'JF_RenderUtil.php';
class JF_View implements JF_IView {

	private $sView;

	private $sLayout;

	private static $aView = array();

	public function __construct($sView, $sLayout = null) {
		$this->sView 	= $sView;
		$this->sLayout	= $sLayout;
	}

	public function set($sKey, $mValue) {
		self::$aView[$sKey] = $mValue;
	}

	public function render() {
		if ($this->sLayout !== null) {
			$oLayout = new JF_Layout($this->sLayout, $this->sView, self::$aView);
			$oLayout->render();
		}
		else if ($this->sView !== null) {
			JF_RenderUtil::renderView($this->sView, self::$aView);
		}

	}

}